import { useMemo, useState } from "react";

const App = () => {
  const [list, setList] = useState([1, 2, 3, 4, 5]);
  function sum() {
    let count = 0;

    list.forEach((v) => (count += v));

    console.log("sum 函数执行一次");
    return count;
  }

  const resukt = useMemo;

  return (
    <div>
      <div>{sum()}</div>
      <div>{sum()}</div>
      <div>{sum()}</div>
    </div>
  );
};

export default App;
